<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('品牌信息列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>订单编号：</label>
                            <input type="text" name="company"/>
                        </li>
                        <li>
                            <label>客户姓名：</label>
                            <input type="text" name="name"/>
                        </li>
                        <li class="select-time">
                            <label>订购时间： </label>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]" lay-key="1">
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]" lay-key="2">
                        </li>
                        <li class="select-time">
                            <label>金额： </label>
                            <input type="text" class="" id="aa" placeholder="" name="params[beginMoney]" lay-key="1">
                            <span>-</span>
                            <input type="text" class="" id="aaa" placeholder="" name="params[endMoney]" lay-key="2">
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('market:check:edit')}]];
    var assignFlag = [[${@permission.hasPermi('market:check:assign')}]];
    var removeFlag = [[${@permission.hasPermi('market:check:remove')}]];
    var prefix = ctx + "market/check";


    function numFormat(num) {
        var c = (num.toString().indexOf ('.') !== -1) ? num.toLocaleString() : num.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
        return c;
    }

    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            orderEditUrl: prefix + "/edit/{orderIndent}",
            assignUrl: prefix + "/assign/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "客户信息",
            columns: [{
                checkbox: true
            },
                {
                    title: '序号',
                    formatter:function (value,row,index) {
                        return $.table.serialNumber(index);
                    }
                },
                {
                    field: 'orderIndent',
                    title: '订单编号'
                },
                {
                    field: 'mkCustomerId',
                    title: '客户姓名'
                },
                {
                    field: '',
                    title: '联系电话'
                },
                {
                    field: 'orderTime',
                    title: '订购时间'
                },
                {
                    field: 'orderMoney',
                    title: '金额',
                    formatter:function (value) {
                        var rmb='￥';
                        if (value!=null){
                            return rmb+numFormat(value);
                        }
                    }
                },
                {
                    field: 'sysOperUserId',
                    title: '操作人'
                },
                {
                    field: 'chkStatus',
                    title: '审核状态',
                    formatter:function(value){
                        if (value==0){
                            return "未审核";
                        }
                        if (value==1){
                            return "审核中";
                        }
                        if (value==2){
                            return "审核通过";
                        }
                        if (value==3){
                            return "审核不通过";
                        }
                    }
                },
                {
                    field: 'sysChkUserId',
                    title: '审核人'
                },
                {
                    field: 'checkTime',
                    title: '审核时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        if (row.chkStatus==1){
                            actions.push('<a class="btn btn-danger btn-xs  ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.orderEdit(\'' + row.orderIndent + '\')"><i class="fa fa-edit"></i>审核</a> ');
                        }
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>